/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  Platform,
  StyleSheet,
  Text,
  View
} from 'react-native';
import HomeComponent from './app/HomeComponent';
import DetailComponent from './app/DetailComponent';

import {StackNavigator} from 'react-navigation';

const App = StackNavigator({
    HomeComponent:{
      screen:HomeComponent,
    },
    DetailComponent:{
      screen:DetailComponent
    }

},{
  initialRouteName:'HomeComponent',
  mode:'card',
  headerMode:'screen',
  //导航栏相关设置项
  header:{
  	    //导航栏可见
          visible : true,
          //左上角的返回键文字, 默认是上一个页面的title
          backTitle : "返回",
          //导航栏的style
          headerStyle: {
              backgroundColor: '#fff'
          },
          //导航栏的title的style
          titleStyle: {
              color: 'green'
          }
  },
  title : 'home',
  //导航栏的style
   headerStyle: {
              backgroundColor: '#fff'
   },
          //导航栏的title的style
   headerTitleStyle: {
           color: 'blue',
           //居中显示
           alignSelf : 'center',
       },

  //是否允许右滑返回，在iOS上默认为true，在Android上默认为false
  cardStack: {
          gesturesEnabled: true,
  },
  onTransitionStart: ()=>{ console.log('导航栏切换开始'); },  // 回调
  onTransitionEnd: ()=>{ console.log('导航栏切换结束'); },  // 回调
});

export default App;
